<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
		<meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
		<title>教师端现场实操章节</title>
		<link rel="stylesheet" type="text/css" href="../../css/api.css"/>
		<link rel="stylesheet" href="../../css/CFNetPP_Base.css">
		<link rel="stylesheet" type="text/css" href="./css/style.css"/>
		<link rel="stylesheet" href="../../css/mui.min.css">
		<link rel="stylesheet" href="../../css/timecontrol.min.css" />
		<link rel="stylesheet" href="../../css/base.css"/>
		<link rel="stylesheet" type="text/css" href="../../css/weui.min.css">
		<style>
			body {
				background: #999999;
			}
			.bian {
				width: 100%;
				height: 30px;
				/*background-color: #18b4ed;*/
			}
			.top_bar {
				position: fixed;
				height: 44px;
				width: 100%;
				/*background-color: #18b4ed;*/
				text-align: center;
				line-height: 44px;
			}
			.top_bar span {
				font-size: 20px;
				color: #fff;
			}
			.top_bar img {
				height: 20px;
				position: absolute;
				top: 50%;
				left: 15px;
				margin-top: -11px;
			}
			.footer {
				background-color: #FFFFFF;
				height: 52px;
				overflow: hidden;
				display: -webkit-box;
				position: fixed;
				bottom: 0;
				width: 100%;
				text-align: center;
				border-top: 1px solid #666666;
			}
			.footer a {
				height: 52px;
				line-height: 52px;
				-webkit-box-flex: 1;
				display: block;
				text-align: center;
				color: #666666;
			}
			.footer img {
				margin-bottom: 3px;
				margin-right: 10px;
				width: 25px;
				height: 25px;
			}
			.base_right_items {
				float: right;
				line-height: 44px;
				right: 180px;
				color: #FFFFFF
			}
		</style>
	</head>
	<body>
		<!-- <div class="bian"></div> -->
		<div class="nav">
			<div class="base_style_color " id='BarAppearance' style="height: 22px;width: 100%"></div>
			<div id="header" class="top_bar base_navigation_bar base_style_color base_navigation_item_bar">
				<a class="base_left_item" href="#" onclick="backClick()"> <img src="../../image/icon_jiantou.png"/> </a>
				<span id="title_score">评分 </span>
				<img id="guanyu" src="../../image/helpInfo.png" style="width: 20px;height: 20px; margin-left: 54%" onclick="helfInfo()" alt="">
				<img id="list_stu" src="../../image/icon_selecXiaozu.png" style="width: 26px;height: 20px; margin-left: 70%;" onclick="open_stu_list()" alt="">
				<a id="upda" class="base_right_items font16" onclick="marksheet();">提交&nbsp;&nbsp;</a>
			</div>
		</div>
		<div class="footer font12">
			<a  onclick="Myscore(2)"><img id="scoreb" style="vertical-align:middle;" src="../../icon/icon_xiaozu.png" /><span id="scorebb" style="color:#18b4ed">教师评分</span></a>
			<a  onclick="Myscore(3)"><img id="scorec" style="vertical-align:middle;" src="../../icon/icon_wodes.png" /><span id="scorecc">学生成绩</span></a>
		</div>
		<div class="noSign" hidden="hidden" id="noData">
			<img src="../../image/icon_img.png" width="60%">
			<p class="font16 top_15 base_dark_grey" >
				暂无数据
			</p>
		</div>
		<div class="loadFailure" hidden="hidden" id="noNet">
			<img src="../../image/icon_img01.png" width="60%">
			<p class="" >
				数据加载失败
			</p>
			<p>
				请检查您的网络
			</p>
			<button type="button" class="mui-btn mui-btn-outlined" onclick="loadNewData()">
				重新加载
			</button>
		</div>
	</body>
	<script type="text/javascript" src="../../script/jquery.min.js"></script>
	<script type="text/javascript" src="../../script/api.js"></script>
	<script type="text/javascript" src="../../script/MD5.js"></script>
	<script src="../../script/common.js"></script>
	<script src="../../script/timeStampTool.js"></script>
	<script src="../../script/processing_images.js"></script>
	<script type="text/javascript" src="../../script/requestTool.js"></script>
	<script type="text/javascript" src="../../script/mui.min.js"></script>
	<script type="text/javascript">
		var vid = "";
		var cid = "";
		var uid = "";
		var jid = "";
		var pid = "";
		var datas = "";
		var list_data = new Object();
		apiready = function() {
			vid = api.pageParam.id;
			uid = api.pageParam.uid;
			jid = api.pageParam.jid;
			pid = api.pageParam.pid;
			cid = api.pageParam.cid;
			// alert(vid+"  " + uid+"  " + jid+"  " + pid+"  " + cid);
			$api.setStorage("sheet_pid", pid);
			var frameH = api.winHeight - 44 - 52 - 22;
			loaddate();
			api.addEventListener({
				name : 'loadnew'
			}, function(ret, err) {
				//coding...
				loaddate();
			});
			api.addEventListener({
				name : 'keyback'
			}, function(ret, err) {
				$api.setStorage('tmpSelectedUid', "");
				api.closeWin({
					name : 'Student_Free_bewrite'
				});
				api.closeWin({});
			});
			$api.setStorage('tmpSelectedUid', "");
			//每次进入现场实操时选择的uid数组赋值为空
			$('#BarAppearance').click(function() {
				api.sendEvent({
					name : 'scrollTop'
				});
			});
		};
		function loaddate() {
			showProgress();
			var params = {
				vid : vid,
				uid : uid,
				jid : jid,
				pid : pid,
				cid : cid
			};
			// alert(JSON.stringify(params));
			//			var url_cf = "http://base.cfnet.org.cn/course/Sitenow_Normal/getSitenowScorelist";
			cfnetppPOST(url_getSitenowScorelist, params, true, function(data, status) {
				hideProgress();
				//				alert(url_getSitenowScorelist);
				// alert(JSON.stringify(data));
				list_data = data;
				$api.setStorage('stu_list_uid', "");
				$api.setStorage('stu_names', "");
				if (status == 'success') {
				    sendBuriedNotifi(0, '教师评分', '046');
					loderfram(data);
				} else {
					loderfram("null");
					// $('#noNet').show();
				}
			});
		}

		function backClick() {
			sendBuriedNotifi(1, '教师评分', '046');
			$api.setStorage('tmpSelectedUid', "");
			api.closeWin({
				name : 'Student_Free_bewrite'
			});
			api.closeWin({});
		}

		function sendBuriedNotifi(busionessid, pagetype, pagetypeid) {
			var userinfo = {
				uid : $api.getStorage('cfnetppuid'),
				jid : $api.getStorage('cfnetppjxid'),
				uname : $api.getStorage('cfnetppusername'),
				cid : cid,
				pid : pid,
				vid : vid
			}
			var data = {
				busionessid : busionessid,
				pagetype : pagetype,
				pagetypeid : pagetypeid,
				sourceurl : api.pageParam.sourceurl,
				sourcetitle : api.pageParam.sourcetitle,
				accesspageurl : window.location.pathname,
				accesspagetitle : document.title,
				userinfo : userinfo
			}
			SendBehaviorTrajectoriesNotifi_Study(data);
		}
		function loderfram(data) {
			frames = [];
			// 添加小组评分页面
			frames.push({
				name : 'new_tea_score_list',
				url : 'new_tea_score_list.html',
				bgColor : '#fff',
				bounces : false,
				vScrollBarEnabled : false,
				pageParam : {
					data : data,
					cdetailtitle : api.pageParam.cdetailtitle
				},
				reload : true,
				hScrollBarEnabled : false
			});
			// 添加我的成绩页面
			frames.push({
				name : 'new_My_grade_tea',
				url : 'new_My_grade_tea.html',
				bgColor : '#fff',
				bounces : false,
				vScrollBarEnabled : false,
				pageParam : {
					pid : pid,
					vid : vid,
					data : data
				},
				hScrollBarEnabled : false,
				reload : true
			});
			var frameH = api.winHeight - 44 - 52 - 22;
			api.openFrameGroup({
				name : 'groups',
				background : '#fff',
				scrollEnabled : false,
				rect : {
					x : 0,
					y : 44 + 22,
					w : api.winWidth,
					h : frameH
				},
				index : 0,
				frames : frames,
				preload : 0,
				reload : true
			}, function(ret, err) {
				//coding...
			});
		}

		function Myscore(type) {
			if (type == 2) {
				sendBuriedNotifi(0, '教师评分', '046');
			} else {
			    sendBuriedNotifi(0, '学生成绩', '050');
			}
			t = document.getElementById('title_score');
			api.setFrameGroupIndex({
				name : 'groups',
				index : type - 2
			});
			if (type == 2) {
				element2 = document.getElementById('scoreb');
				element2.src = "../../icon/icon_xiaozu.png";
				element3 = document.getElementById('scorec');
				element3.src = "../../icon/icon_wodes.png";
				element5 = document.getElementById('scorebb');
				element5.style.color = "#18b4ed";
				element6 = document.getElementById('scorecc');
				element6.style.color = "#666666";
				// 设置顶部文字变换
				t.innerHTML = "评分";
				// 设置“选择学生”显示
				s = document.getElementById("list_stu");
				s.style.visibility = "visible";
				// 设置“提交”按钮显示
				sbm = document.getElementById("upda");
				sbm.style.visibility = "visible";
				var g = document.getElementById("guanyu");
				g.style.visibility = "visible";
			}
			if (type == 3) {
				element2 = document.getElementById('scoreb');
				element2.src = "../../icon/icon_xiaozus.png";
				element3 = document.getElementById('scorec');
				element3.src = "../../icon/icon_wode.png";
				element5 = document.getElementById('scorebb');
				element5.style.color = "#666666";
				element6 = document.getElementById('scorecc');
				element6.style.color = "#18b4ed";
				// 设置顶部文字变换
				t.innerHTML = "学生成绩";
				// 设置“选择学生”隐藏
				s = document.getElementById("list_stu");
				s.style.visibility = "hidden";
				// 设置“提交”按钮隐藏
				sbm = document.getElementById("upda");
				sbm.style.visibility = "hidden";
				var g = document.getElementById("guanyu");
				g.style.visibility = "hidden";
				api.sendEvent({
					name : 'mylist_up'
				});
			}
		}
		// 打开学生选择界面
		function open_stu_list() {
			api.openWin({useWKWebView:true,
				name : 'teacher_select_student_window',
				url : 'teacher_select_student_window.html',
				pageParam : {
					vid : vid,
					uid : uid,
					jid : jid,
					pid : pid,
					cid : cid,
					ifteacherstudy:api.pageParam.ifteacherstudy
				}
			});
		}
		//数据提交
		function marksheet() {
			api.sendEvent({
				name : 'sublimt',
				extra : {}
			});
		}
		//重新加载数据
		function loadNewData() {
			// 隐藏显示的无数据布局
			$('#noNet').hide();
			$('#noData').hide();
			loaddate();
		}
		function helfInfo() {
			api.openWin({useWKWebView:true,
				name : 'new_guanyu',
				url : '../Study/new_guanyu.html'
			});
		}
	</script>
</html>